<?php
function get_sm_webdata(){
   $sql = "select a.company shopName,a.username number,a.address,a.business,a.areaid,b.content from destoon_company a left join 
       destoon_company_data b on a.userid = b.userid where a.groupid = 6 group by a.username ";
   return M()->db(2,'DB_CONFIG_SM')->query($sql);
}

function tree($directory)
{
    $str = "";
    $mydir = dir($directory);
    while($file = $mydir->read())
    {
        if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!=".."))
        {
            //$str .= $file;
            tree("$directory/$file");
        }
        else{
            if(($file!=".") AND ($file!="..")){
                $str .= substr($directory."/".$file."\r\n","1");
               
            }
        }
    }
    if($str!=""){
        $urlfile = fopen("./data/url.appcache","a");
        fwrite($urlfile,$str);
        fclose($urlfile);
    }
   
    
    $mydir->close();
    
}